<template>
<div id="home">
  <nav-bar class="home-nav">
    <div slot="center">购物街</div>
  </nav-bar>
  <home-swiper :cbanners="banners"></home-swiper>
 <home-recommend :crecommends="recommends"></home-recommend>
</div>
</template>

<script>

import NavBar from 'components/common/navbar/NavBar'
import HomeSwiper from '@/views/home/childComps/HomeSwiper'
import HomeRecommend from '@/views/home/childComps/HomeRecommendView'
// import {getHomeMultifdata} from "@/network/home";
import {getHomeMultifdata} from '@/api/index'

export default {
  name: "Home",
  data(){
    return {
      banners:[],
      recommends:[]
    }
  },
  components : {
    NavBar,HomeSwiper,HomeRecommend
  },
  // created() {
  //   getHomeMultifata().then(res => {
  //     this.banners = res.data.banner.list;
  //     this.recommends = res.data.recommend.list;
  //   })
  // }
  mounted() {
    getHomeMultifdata().then(data => {
      console.log(data)
      this.banners = data.data.banner.list
      this.recommends = data.data.recommend.list
    })
  }
}
</script>

<style scoped>
.home-nav {
  background-color:var(--color-tint);
  color: white;
}

</style>